//
//  VIUCustomInputTextView.h
//  lightPlaySDK
//
//  Created by jagger.tu on 2023/3/6.
//  Copyright © 2023 CloudSky All rights reserved.
//

#if TARGET_OS_IOS

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

#define VIU_KEYBOARD_POP_NOTIFICATION @"VIU_KEYBOARD_POP_NOTIFICATION"

@class JGInputTextView;

/// 输入视图的时间代理
@protocol JGInputTextViewDelegate <NSObject>

/// 输出完成后,回调输入的内
- (void)inputCompletedWithTextView:(JGInputTextView *)textView text:(NSString *)text;
/// 输入取消
- (void)inputCancelWithTextView:(JGInputTextView *)textView;

@end

@interface JGInputTextView : UIView

/// 设置代理
@property (nonatomic, weak) id<JGInputTextViewDelegate> delegate;
/// 键盘显示状态。
/// 请勿主动设置，否则键盘显示会异常
@property (nonatomic, assign) BOOL bviuPush;
/// 键盘类型
@property (nonatomic, assign) int keyboardType;
/// 键盘背景，可通过重写 'configUI' 自定义 UI
@property (nonatomic, strong) UIView *backgroundView;
/// 输入框，但不能直接赋值。可通过设置 'text' 或重写 'configUI' 自定义 UI
@property (nonatomic, strong) UITextView *textView;
/// 确认按钮，可通过重写 'configUI' 自定义 UI
@property (nonatomic, strong) UIButton *okBtn;
/// 取消按钮，可通过重写 'configUI' 自定义 UI
@property (nonatomic, strong) UIButton *cancelBtn;
/// 分隔线，可通过重写 'configUI' 自定义 UI
@property (nonatomic, strong) UIView *lineView;
/// 输入框中输入的文本或获取当前文本
@property (nonatomic, strong) NSString *text;
/// 控件间距
@property (nonatomic ,assign, readonly) CGFloat space;
/// 输入框文本区域宽度
@property (nonatomic, assign, readonly) CGFloat textViewWidth;
/// 安全区域
@property (nonatomic, assign, readonly) UIEdgeInsets safeEdge;
/// 按钮宽度
@property (nonatomic, assign, readonly) CGFloat btnWidth;
/// 按钮高度
@property (nonatomic, assign, readonly) CGFloat btnHeight;
/// 输入框最小高度
@property (nonatomic, assign, readonly) CGFloat minTextViewHeight;
/// 输入框最大高度
@property (nonatomic, assign, readonly) CGFloat maxTextViewHeight;
/// 设置键盘顶部高度
@property (nonatomic, assign) CGFloat topKeyboardHeight;
/// 空白时提示文案
@property (nonatomic, strong) UILabel *placeholderLabel;
/// 显示键盘
- (void)beginEdit;
/// 隐藏键盘
- (void)endEdit;
/// 重写，每次布局时调用
- (void)layoutUI;
/// 配置UI样式，仅调用一次
- (void)configUI;
/// 键盘隐藏后的处理
- (void)keyboardPopNotification;

@end

NS_ASSUME_NONNULL_END

#endif
